package com.guoyh.adapter.base

import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import com.chad.library.adapter.base.viewholder.BaseViewHolder

abstract class BaseRlvBindAdapter<T,DB : ViewDataBinding>(layoutResId: Int, data: MutableList<T>) :
    SupportRlvAdapter<T, BaseViewHolder>(layoutResId, data) {
    override fun convert(holder: BaseViewHolder, item: T) {
        val binding: DB? = DataBindingUtil.bind<DB>(holder.itemView)
        if (binding!=null){
            toConvert(holder,item, binding)
        }
    }


    abstract fun toConvert(holder: BaseViewHolder,item: T,binding:DB)
}